package mywebapps.common.jsf;

import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;

public class ImagesUtil {
	public static final String IMAGES_FOLDER = "/images";
	public static final String PAINTINGS_FOLDER = "/paintings";
	public static final String SKETCHES_FOLDER = "/sketches";
	public static final String PHOTOGRAPHS_FOLDER = "/photographs";
	
	public static String getImagesPath() {
    	ServletContext ctx = (ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext();
    	return ctx.getRealPath(IMAGES_FOLDER);
    }
	
	public static String getPaintingsPath() {
		return getImagesPath() + PAINTINGS_FOLDER;
	}
	
	public static String getSketchesPath() {
		return getImagesPath() + SKETCHES_FOLDER;
	}
	
	public static String getPhotographsPath() {
		return getImagesPath() + PHOTOGRAPHS_FOLDER;
	}
}
